#!/bin/bash

# 目标文件系统: RK3399 debian10
apt-get install python-rosdep python-rosinstall-generator python-wstools python-rosinstall build-essential python-empy python-nose
apt-get install cmake doxygen libboost-all-dev googletest libconsole-bridge-dev libpoco-dev libeigen3-dev liblog4cxx-dev libtinyxml-dev libtinyxml2-dev libyaml-cpp-dev
apt-get install qt5-default pyqt5-dev-tools python-pyqt5 python3-pyqt5 libcurl4-nss-dev liblz4-dev libpkgconfig-perl 
apt-get install liburdfdom-headers-dev libbz2-dev libgpgme-dev libopencv-dev liburdfdom-dev libogre-1.9-dev libassimp-dev
pip2 install empy nose python-qt5 pyqt5 numpy defusedxml netifaces crypto pycrypto gnupg

# 编译ARM64版本的sip
tar zxvf sip-4.19.13.tar.gz
cd sip-4.19.13
python configure.py
make -j4
sudo make install
cd .. 

# 编译ARM64版本的PyQt5
tar zxvf PyQt5_gpl-5.11.3.tar.gz
cd PyQt5_gpl-5.11.3
python configure.py
make -j4
sudo make install
cd .. 

# 解压缩ros源码包
./rosupdate -x melodic-desktop-wet.rosinstall

# 解压缩rosdistro
tar zxvf rosdistro.tar.gz

# 编译
mkdir -p /opt/ros/melodic
./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/melodic

